package com.fit.beans;

import java.util.LinkedList;
import java.util.List;

import com.fit.interfaces.Borrow;
import com.fit.interfaces.Car;
import com.fit.interfaces.Driver;
import com.fit.interfaces.Employer;
import com.fit.interfaces.RecordDamage;
import com.fit.service.BorrowUniqueID;
import com.fit.service.Borrows;

public class BorrowBean implements Borrow {

	private String id;
	private List<Car> car;
	private Driver driver;
	private Employer employer;
	
	private List<RecordDamage> recordDamage;
	
	
	
	public List<RecordDamage> getRecordDamage() {
		return recordDamage;
	}

	public void setRecordDamage(List<RecordDamage> recordDamage) {
		this.recordDamage = recordDamage;
	}

	public List<Car> getCar() {
		// TODO Auto-generated method stub
		return this.car;
	}

	public Driver getDriver() {
		// TODO Auto-generated method stub
		return this.driver;
	}

	public Employer getEmployer() {
		// TODO Auto-generated method stub
		return this.employer;
	}

	public String getID() {
		// TODO Auto-generated method stub
		return this.id;
	}

	public void setCar(List<Car> car) {
		// TODO Auto-generated method stub
		this.car = car;
	}

	public void setDriver(Driver driver) {
		// TODO Auto-generated method stub
		this.driver = driver;
	}

	public void setEmployer(Employer employer) {
		// TODO Auto-generated method stub
		this.employer = employer;
	}

	public void setID(String id) {
		// TODO Auto-generated method stub
		this.id = id;
	}

	public void executeBorrowCreation(Driver driver, Employer employer,
			Car car, Borrows borrows) {
		// TODO Auto-generated method stub
		this.setID(BorrowUniqueID.getBorrowUniqueID());
		this.setDriver(driver);
		this.setEmployer(employer);
		List<Car> tempList = new LinkedList<Car>(); 
			tempList.add(car);
			this.setCar(tempList);
			
//			this.driver.getBorrow().add(this);
//			this.employer.getBorrow().add(this);
//			this.car.g
			driver.getBorrow().add(this);
			employer.getBorrow().add(this);
			car.getBorrow().add(this);
			
			borrows.save(this);
			
			
			
	}
	
}
